package com.mybatis;

import com.mybatis.mapper.OrdersMapper;
import com.mybatis.pojo.Orders;
import com.mybatis.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class Part19 {
    public static void findOrdersTest() {
        SqlSession sqlSession = MyBatisUtils.getSession();
        OrdersMapper ordersMapper = sqlSession.getMapper(OrdersMapper.class);
        List<Orders> ordersList = ordersMapper.findOrdersByUserID4(1);
        for (Orders orders : ordersList) {
            System.out.println(orders);
        }
        sqlSession.close();
    }

    public static void main(String[] args) {
        findOrdersTest();
    }
}